import {Entity,  Column, PrimaryGeneratedColumn,OneToOne,JoinColumn} from "typeorm";
import {TimeEntity} from './TimeEntity';
import {CountryEntity} from './CountryEntity';
import { ThinkInfoEntity } from "./ThinkInfoEntity";
import { PaintInfoEntity } from "./PaintInfoEntity";
import { AncientInfoEntity } from "./AncientInfoEntity";

@Entity("think")
export class ThinkEntity{
    @PrimaryGeneratedColumn()
    id!: number;

	@Column()
    think_Title!: string;

    @Column({length:500})
    think_IndexImageUrl!: string;

    @Column()
    think_Category!: number;

    @Column()
    think_CreateTime!: Date;

    @Column()
    think_CollectionType!: number;

    @Column()
    think_WatchType!: number;

    @Column()
    think_BlockType!: number;

    @Column()
    think_UserImage!: String;

    @Column()
    think_LikeType!: number;

    @Column()
    think_IndexImageWidth!: number;

    @Column()
    think_IndexImageHeight!: number;

    @Column()
    thinkTimeTimeId!: number;
    
    @Column()
    thinkCountryId!: number;

    @OneToOne(()=>TimeEntity)
    @JoinColumn()
    think_Time!:TimeEntity;

    @OneToOne(()=>CountryEntity)
    @JoinColumn()
    think_Country!:CountryEntity;

    @Column()
    think_Times!: string;

    @Column()
    think_Paint_Style!:number;

    @Column()
    think_Paint_Theme!:number;

    @Column()
    think_Paint_Raw!:number;

    @Column()
    think_Ancient_Position!:number;

    @Column()
    think_Ancient_Type!:number;

    @Column()
    think_BigTime!:number;

    @Column()
    isLike:boolean = false;

    @Column()
    isCollection:boolean = false;

    @Column()
    thinkInfoThinkId!: number;

    @Column()
    thinkPaintPaintId!: number;

    @Column()
    thinkAncientAncientId!: number;

    @OneToOne(()=>ThinkInfoEntity)
    @JoinColumn()
    think_Info!:ThinkInfoEntity;

    @OneToOne(()=>PaintInfoEntity)
    @JoinColumn()
    think_Paint!:PaintInfoEntity;

    @OneToOne(()=>AncientInfoEntity)
    @JoinColumn()
    think_Ancient!:AncientInfoEntity;
    
}